Repository navigation
Conversation
Redact JSON documents stored as strings, such as the A01 product info data point, which exposed the serial number, Wi-Fi name, IP and MAC. Also redact ssid and iotName. Decode the A01 product info and voice pack data points, which the device reports as JSON strings and always decoded to None, and add the decoded A01 state to device diagnostics as traits.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A01 devices report some data points as JSON stored in a string.
redact_device_dataonly checked dictionary keys, so DP 10005 (product info) went into diagnostics unredacted, with the serial number, Wi-Fi name, IP and MAC. Home Assistant diagnostics build this section fromdevice.diagnostic_data(), so the values ended up in downloaded diagnostics files.Changes
redact_device_datanow also redacts JSON documents stored as strings. A string that looks like JSON but cannot be parsed is fully redacted. A string with nothing to redact is returned unchanged.ssidandiotNameare now redacted.iotNameholds the same user-given room name as the already redactedrawName.SND_STATE(10004) andPRODUCT_INFO(10005) now decode. The device sends them as JSON strings, but the converters passed the string tofrom_dict, so they always returnedNone.traitsindiagnostic_data(), as V1 and Q10 devices do.Testing
a194) and a Saros 10R (a144). None of the identifiers remained in the output.This does not depend on #1021 and merges cleanly with it in either order.